package com.home.Entity;


import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.persistence.Transient;

import org.hibernate.annotations.Proxy;

@Entity
@Proxy(lazy=false)
@Table(name="TAIKHOAN")
public class TaiKhoan {
	
	@Id
	@Column(name="TKH_MASO")
	private long maSo;
	
	@Column(name="TKH_NAME")
	private String ten;
	
	@Column(name="TKH_PASS")
	private String matKhau;
	
	@Column(name="TKH_TINHTRANG")
	private boolean tinhTrang;
	
	@Column(name="TKH_TRANGTHAI")
	private boolean trangThai;
	
	@Column(name="TKH_GHICHU")
	private String ghiChu;
	
	@Column(name="TKH_LOAI")
	private boolean loai;
	
	@ManyToOne
	@JoinColumn(name="TKH_NHANVIEN")
	private  NhanVien nhanVien;
	
	@Transient
	private String nameNhanVien;
	
	public long getMaSo() {
		return maSo;
	}
	public void setMaSo(long maSo) {
		this.maSo = maSo;
	}
	public String getTen() {
		return ten;
	}
	public void setTen(String ten) {
		this.ten = ten;
	}
	public String getMatKhau() {
		return matKhau;
	}
	public void setMatKhau(String matKhau) {
		this.matKhau = matKhau;
	}
	public boolean isTinhTrang() {
		return tinhTrang;
	}
	public void setTinhTrang(boolean tinhTrang) {
		this.tinhTrang = tinhTrang;
	}
	public boolean isTrangThai() {
		return trangThai;
	}
	public void setTrangThai(boolean trangThai) {
		this.trangThai = trangThai;
	}
	public String getGhiChu() {
		return ghiChu;
	}
	public void setGhiChu(String ghiChu) {
		this.ghiChu = ghiChu;
	}
	public boolean isLoai() {
		return loai;
	}
	public void setLoai(boolean loai) {
		this.loai = loai;
	}
	public NhanVien getNhanVien() {
		return nhanVien;
	}
	public void setNhanVien(NhanVien nhanVien) {
		this.nhanVien = nhanVien;
	}
	public String getNameNhanVien() {
		return getNhanVien().getTen();
	}
	public void setNameNhanVien(String nameNhanVien) {
		this.nameNhanVien = nameNhanVien;
	}
	@Override
	public String toString() {
		return getNameNhanVien() +" - "+ getTen();
	}
	
}
